package a.b;

import a.c.q;

import java.util.Iterator;

final class f
{
  static g a()
  {
    return new d_(null);
  }
  
  static g c()
  {
    return new b_(null);
  }
  
  private static final class b_
    extends f.c_
  {
    private b_() {}
    
    public void a()
    {
      boolean bool = d.o;
      int i = d.n;
      this.b = true;
      if (!bool)
      {
        if (this.a.isEmpty()) {
          return;
        }
        super.a();
      }
      do
      {
        Iterator localIterator = this.a.iterator();
        while (i == 0)
        {
          if (!localIterator.hasNext()) {
            break;
          }
          ((c)localIterator.next()).a();
        }
      } while (bool);
    }
    
    public void a(double paramDouble)
    {
      boolean bool = d.o;
      int i = d.n;
      if (!bool) {
        if (this.a.isEmpty()) {
          return;
        }
      }
      do
      {
        if (paramDouble <= this.i) {
          break;
        }
        if (i != 0) {
          break label95;
        }
        if ((!bool) && (!this.f.hasNext())) {
          break;
        }
        if (!bool)
        {
          if (this.k < 1.0D) {
            this.g.a(1.0D);
          }
          e();
        }
      } while (i == 0);
      if (!bool) {
        label95:
        super.a(paramDouble);
      }
    }
    
    public void b()
    {
      boolean bool = d.o;
      int i = d.n;
      if (!bool) {
        if (this.a.isEmpty())
        {
          this.b = false;
          return;
        }
      }
      Iterator localIterator = this.a.iterator();
      if (localIterator.hasNext()) {}
      do
      {
        ((c)localIterator.next()).b();
        if ((!bool) && (i != 0)) {
          return;
        }
        if (i == 0) {
          break;
        }
        super.b();
      } while (bool);
      this.b = false;
    }
    
    b_(f.0 param0)
    {
      this();
    }
  }
  
  private static final class d_
    extends f.c_
  {
    private d_() {}
    
    public void a()
    {
      this.b = true;
      if (!d.o)
      {
        if (this.a.isEmpty()) {
          return;
        }
        super.a();
      }
      this.g.a();
    }
    
    public void a(double paramDouble)
    {
      boolean bool = d.o;
      int i = d.n;
      if (!bool) {
        if (this.a.isEmpty()) {
          return;
        }
      }
      do
      {
        if (paramDouble < this.i) {
          break;
        }
        if (i != 0) {
          break label113;
        }
        if ((!bool) && (!this.f.hasNext())) {
          break;
        }
        if (!bool)
        {
          if (this.k < 1.0D) {
            this.g.a(1.0D);
          }
          this.g.b();
          e();
          this.g.a();
        }
      } while (i == 0);
      if (!bool) {
        label113:
        super.a(paramDouble);
      }
    }
    
    public void b()
    {
      if (!d.o)
      {
        if (this.a.isEmpty())
        {
          this.b = false;
          return;
        }
        this.g.b();
        super.b();
      }
      this.b = false;
    }
    
    d_(f.0 param0)
    {
      this();
    }
  }
  
  private static abstract class c_
    extends e
  {
    long d = 0L;
    long e = 0L;
    Iterator f = null;
    c g = null;
    double h = 0.0D;
    double i = 0.0D;
    double j = 1.0D;
    double k = 0.0D;
    
    public void a()
    {
      f();
      this.f = this.a.iterator();
      e();
    }
    
    public void a(double paramDouble)
    {
      boolean bool = d.o;
      if (!bool) {
        if (bool) {
          break label45;
        }
      }
      label45:
      double d1 = paramDouble < 1.0D ? 1.0D : 0.0D < this.j ? (paramDouble - this.h) / this.j : 1.0D;
      if (!bool) {
        if (1.0D < d1)
        {
          d1 = 1.0D;
          if (bool) {
            return;
          }
        }
      }
      if ((d.n != 0) && ((bool) || (0.0D > d1))) {
        d1 = 0.0D;
      }
      this.g.a(d1);
      this.k = d1;
    }
    
    public void b()
    {
      f();
    }
    
    public long c()
    {
      boolean bool = d.o;
      int m = d.n;
      if (!bool) {
        if (this.c)
        {
          this.d = 0L;
          Iterator localIterator = this.a.iterator();
          if (localIterator.hasNext()) {}
          for (;;)
          {
            if (!bool)
            {
              this.d += ((c)localIterator.next()).c();
              if (m == 0)
              {
                if (m == 0) {
                  break;
                }
                if (bool) {
                  continue;
                }
                this.c = false;
              }
            }
          }
        }
      }
      return this.d;
    }
    
    void e()
    {
      boolean bool = d.o;
      int m = d.n;
      this.g = ((c)this.f.next());
      long l1 = this.g.c();
      this.e += l1;
      long l2 = c();
      if (!bool) {}
      this.j = (l1 == l2 ? 1.0D : l1 / l2);
      this.h = this.i;
      if (!bool) {}
      this.i = (this.e == l2 ? 1.0D : this.e / l2);
      if (!bool)
      {
        if (q.n) {
          m++;
        }
      }
      else {
        d.n = m;
      }
      if (q.o) {
        d.o = !bool;
      }
    }
    
    private void f()
    {
      this.f = null;
      this.g = null;
      this.e = 0L;
      this.j = 1.0D;
      this.h = 0.0D;
      this.i = 0.0D;
      this.k = 0.0D;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.b.f

 * JD-Core Version:    0.7.0.1

 */